package com.zaydanwu.cla.controller.students;

import com.zaydanwu.cla.model.StudentCourse;
import com.zaydanwu.cla.model.result.ApiResult;
import com.zaydanwu.cla.service.StudentCourseService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @BelongsProject: cla
 * @BelongsPackage: com.zaydanwu.cla.controller.students
 * @Author: zaydanwu
 * @CreateTime: 2018-12-10 22:51
 * @Description:
 */
@RestController
@RequestMapping("/cla/api")
public class StudentCourseController {

    @Resource
    private StudentCourseService studentCourseService;

    @RequestMapping("/getStudentCourse")
    public ApiResult<List<StudentCourse>> getStudentCourse(@RequestParam Long stuNo) {
        List<StudentCourse> studentCourse = studentCourseService.getStudentCourse(stuNo);
        return ApiResult.success(studentCourse);
    }
}
